﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wfTree
{
	public partial class ctlAddPerson : UserControl
	{
		public override string Text
		{
			get { return lbAddText.Text; }
			set { lbAddText.Text = value; }
		}
		public DbFtPerson RelatedTo;
		public Relationship Relation;
		public ctlAddPerson()
		{
			InitializeComponent();
		}

		private void pbAdd_Click(object sender, EventArgs e)
		{
			lbAddText_Click(sender, e);
		}

		private void lbAddText_Click(object sender, EventArgs e)
		{
			Program.FUserDetail.Relation = Relation;
			Program.FUserDetail.PersonRelatedTo = RelatedTo;
			Program.FUserDetail.ShowDialog(this.ParentForm);
			if (Program.FUserDetail.PersonEdit != null)
				Program.MainForm.LoadUpPerson(RelatedTo.PersonId);
		}
	}
}
